package com.pine.dbant.common.plugin;

import com.pine.dbant.common.exeception.ProviderException;
import com.pine.dbant.common.model.ConnectionInfo;
import com.pine.sunflower.core.plugin.Configuration;

/**
 * @author xiaoyuan
 * @create 2022/11/4 17:38
 **/
public abstract class AbstractConnector implements Connector{

    protected  ConnectionInfo connectionInfo;
    protected Configuration configuration;

    protected AbstractConnector(){

    }

    public AbstractConnector(Configuration configuration,ConnectionInfo connectionInfo){
        this.configuration  = configuration;
        this.connectionInfo = connectionInfo;
    }

    @Override
    public void commit() throws ProviderException {

    }

    @Override
    public void rollback() throws ProviderException, UnsupportedOperationException {
        throw new UnsupportedOperationException("Transactions are not supported by "+toString());
    }
}
